<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<!DOCTYPE html>
<html lang="zh-CN">
<head>

  <fmt:setBundle basename="ApplicationMessage" />
  <fmt:setLocale value="zh_CN" />

  <%@ include file="/WEB-INF/include/meta.jsp"%>
  <%@ include file="/WEB-INF/include/css.jsp"%>
  <link href="${ctx.resource}/css/select2.css" rel="stylesheet">
  <link href="${ctx.resource}/css/select2-bootstrap.css" rel="stylesheet">
  <link href="${ctx.resource}/css/bootstrap-datetimepicker.min.css" rel="stylesheet">

</head>
<body>
    
    <div style="padding:10px;">
      <p>支付时间：<fmt:formatDate value="${time}" pattern="yyyy-MM-dd hh:mm:ss" /></p>

      <h4 class="vertical-margin-10">保理合同信息</h4>
      
      <div class="panel panel-default" style="width:1000px;">
        <div class="panel-body">
         
         <div class="row">
         
          <div class="text-align-right col-xs-2 col-md-2"><p class="title"><strong>合同编号:</strong></p></div>
          <div class="text-align-left col-xs-2 col-md-2"><p>${factoringContract.contractNo}</p></div>
          
          <div class="text-align-right col-xs-2 col-md-2"><p class="title"><strong>融资方:</strong></p></div>
          <div class="text-align-left col-xs-2 col-md-2"><p>${factoringContract.borrowerName}</p></div>
          
          <div class="text-align-right col-xs-2 col-md-2"><p class="title"><strong>融资方银行户名:</strong></p></div>
          <div class="text-align-left col-xs-2 col-md-2"><p>${factoringContract.lenderAcBkName}</p></div>
          
         </div>
         
         <div class="row">
         
          <div class="text-align-right col-xs-2 col-md-2"><p class="title"><strong>融资方账号:</strong></p></div>
          <div class="text-align-left col-xs-2 col-md-2"><p>${factoringContract.lenderAcNo}</p></div>
         
          <div class="text-align-right col-xs-2 col-md-2"><p class="title"><strong>准备金释放方式:</strong></p></div>
          <div class="text-align-left col-xs-2 col-md-2"><p><fmt:message key="${factoringContract.depositDeductType.key}" /></p></div>
          
          <div class="text-align-right col-xs-2 col-md-2"><p class="title"><strong>手续费收取方式:</strong></p></div>
          <div class="text-align-left col-xs-2 col-md-2"><p><fmt:message key="${factoringContract.costDeductType.key}" /></p></div>
          
         </div>
         
         <div class="row">
         
          <div class="text-align-right col-xs-2 col-md-2"><p class="title"><strong>扣息方式:</strong></p></div>
          <div class="text-align-left col-xs-2 col-md-2"><p><fmt:message key="${factoringContract.intAccuretype.key}" /></p></div>
         
          <div class="text-align-right col-xs-2 col-md-2"><p class="title"><strong>融资比例:</strong></p></div>
          <div class="text-align-left col-xs-2 col-md-2"><p><fmt:formatNumber type="percent"  maxIntegerDigits="3" value="${factoringContract.advaPct}" /></p></div>
          
          <div class="text-align-right col-xs-2 col-md-2"><p class="title"><strong>核销比例:</strong></p></div>
          <div class="text-align-left col-xs-2 col-md-2"><p><fmt:formatNumber type="percent"  maxIntegerDigits="3" value="${factoringContract.settlePct}" /></p></div>
          
         </div>
         
         <div class="row">
         
          <div class="text-align-right col-xs-2 col-md-2"><p class="title"><strong>手续费率:</strong></p></div>
          <div class="text-align-left col-xs-2 col-md-2"><p>${factoringContract.arCostRate}%</p></div>
         
          <div class="text-align-right col-xs-2 col-md-2"><p class="title"><strong>融资期限（日）:</strong></p></div>
          <div class="text-align-left col-xs-2 col-md-2"><p>${factoringContract.advaTerm}</p></div>
          
          <div class="text-align-right col-xs-2 col-md-2"><p class="title"><strong>融资宽限期:</strong></p></div>
          <div class="text-align-left col-xs-2 col-md-2"><p>${factoringContract.advaMatuterm}</p></div>
          
         </div>
         
         <div class="row">
         
          <div class="text-align-right col-xs-2 col-md-2"><p class="title"><strong>融资利率:</strong></p></div>
          <div class="text-align-left col-xs-2 col-md-2"><p><fmt:formatNumber type="percent"  maxIntegerDigits="3" value="${factoringContract.intRate}" /></p></div>
          
         </div>
         
        </div>
        <div class="panel-footer">
        
          <table class="table table-striped demo2do-table bottom-margin-20 text-left settlement">
        
            <tr>
              <td>
                <p class="title"><strong>应收款总额</strong></p>
                <p>${factoringContract.arAmt}</p>
              </td>
        
              <td>
                <p class="title"><strong>应收账款余额</strong></p>
                <p>${factoringContract.arLdgamt}</p>
              </td>
            </tr>
        
            <tr>
              <td>
                <p class="title"><strong>融资额本金（初始）</strong></p>
                <p>${factoringContract.otsdAmt}</p>
              </td>
            
              <td>
                <p class="title"><strong>融资余额</strong></p>
                <p>${factoringContract.otsdAmtAval}</p>
              </td>
            </tr>
        
            <tr>
              <td>
                <p class="title"><strong>风险准备金</strong></p>
                <p>${factoringContract.arDepositAmt}</p>
              </td>
              
              <td>
                <p class="title"><strong>本次核销后风险金余额</strong></p>
                <p>${factoringContract.arDepositAmtAval}</p>
              </td>
            </tr>
        
            <tr>
              <td>
                <p class="title"><strong>融资起始日</strong></p>
                <p><fmt:formatDate value="${factoringContract.advaStartDate}" pattern="yyyy/MM/dd" /></p>
              </td>
              
              <td>
                <p class="title"><strong>本次核销时间</strong></p>
                <p><fmt:formatDate value="${settlementDate}" pattern="yyyy/MM/dd HH:mm:SS" /></p>
              </td>
            </tr>
       
          </table>
          
        </div>
      </div>
    
      <h4 class="vertical-margin-10">本次核销明细</h4>
      
      <div class="detail table-warp" style="width:100%">
      
        <div class="panel panel-default">
        
          <div class="panel-body">
            
          </div>
          
          <div class="panel-footer">
            <table class="table table-striped demo2do-table bottom-margin-20 text-left settlement print">
      
            <tbody>
      
              <tr>
              <th>应收账款编号</th>
              <th>前次核销后融资余额合计</th>
              <th>租赁合同号</th>
              <th >当期应还款日</th>
              <th>融资起始日</th>
              <th>实际到账日</th>
              <th>计息天数</th>
              <th>到账金额</th>
              <th>手续费</th>
              <th>利息</th>
              <th>本次还本金额</th>
              <th>尾款</th>
              <th>释放风险准备金</th>
              <th>补充风险准备金</th>
              <th>融资余额</th>
              <th>租客</th>
            </tr>
                  <c:forEach var="settleItem" items="${settleItems}">
                <tr>
                  <td>${settleItem.financePaymentRecord.order.orderNo}</td>
                  <td>${settleItem.otsdAmtAvalPre}</td>
                  <td>${settleItem.financePaymentRecord.order.contract.contractNo}</td>
                  <td><fmt:formatDate value="${settleItem.financePaymentRecord.order.dueDate}" pattern="yyyy-MM-dd" /></td>
                  <td><fmt:formatDate value="${settleItem.factoringContract.advaStartDate}" pattern="yyyy-MM-dd" /></td>
                  <td><fmt:formatDate value="${settleItem.financePaymentRecord.order.payoutTime}" pattern="yyyy-MM-dd" /></td>
                  <td>${settleItem.intDuration}</td>
                  <td>${settleItem.financePaymentRecord.payMoney}</td>
                  <td>${settleItem.arCost}</td>
                  <td>${settleItem.payInt}</td>
                  <td>${settleItem.payOstdAmt}</td>
                  <td>${settleItem.payRemant}</td>
                  <td>${settleItem.depositDeductAmt}</td>
                  <td>${settleItem.arDepositInputAmt}</td>
                  <td>${settleItem.otsdAmtAval}</td>
                  <td>${settleItem.financePaymentRecord.order.customer.name}</td>
                </tr>
                  </c:forEach>
            </tbody>
      
            <tfoot>
      
            <tr>
              <td></td>
              <td></td>
              <td></td>
              <td></td>
              <td></td>
              <td></td>
              <td>合计</td>
              <td>${settleRecord.totalPayMoney}</td>
              <td>${settleRecord.totalArCost}</td>
              <td>${settleRecord.totalPayInt}</td>
              <td>${settleRecord.totalPayOstdAmt}</td>
              <td>${settleRecord.totalPayRemant}</td>
              <td>${settleRecord.totalDepositDeductAmt}</td>
              <td></td>
              <td></td>
            </tr>
      
            </tfoot>
      
          </table>
      
        </div>
        
      </div>
        
     </div>
     
    
      <h4 class="vertical-margin-10">资金清分明细</h4>
    
      <div class="row" style="width:1000px">
      
        <div class="col-xs-4">
          <table class="table table-striped demo2do-table bottom-margin-20 text-left settlement">
            <tr>
              <td>收款方</td>
              <td>${factoringContract.lenderName}</td>        
            </tr>
            <tr>
              <td>利息</td>
              <td>${settleRecord.totalPayInt}</td>  
            </tr>
            <tr>
              <td>本金</td>
              <td>${settleRecord.totalPayOstdAmt}</td>
            </tr>
            <tr>
              <td>补充风险准备金</td>
              <td>${settleRecord.totalArDepositInputAmt}</td>
            </tr>
            <tr>
              <td>合计</td>
              <td>${lenderTotal}</td>
            </tr>
          </table>
        </div>
        
      	<div class="col-xs-4">
  		  <table class="table table-striped demo2do-table bottom-margin-20 text-left settlement">
    		<tr>
    			<td>收款方</td>
    			<td>${factoringContract.borrowerName}</td>				
    		</tr>
    		<tr>
    			<td>释放风险准备金</td>
    			<td>${settleRecord.totalDepositDeductAmt}</td>	
    		</tr>
    		<tr>
    			<td>尾款</td>
    			<td>${settleRecord.totalPayRemant}</td>
    		</tr>
    		<tr>
    			<td>合计</td>
    			<td>${borrowerTotal}</td>
    		</tr>
  		  </table>
      	</div>
        
      </div>
    
    </div>
  
  <%@ include file="/WEB-INF/include/script.jsp"%>
  <script src="${ctx.resource}/js/bootstrap-switch.min.js"></script>
  <script src="${ctx.resource}/js/bootstrap-modal-trigger.js"></script>
  <script src="${ctx.resource}/js/select2.min.js"></script>
  <script src="${ctx.resource}/js/select2_locale_zh-CN.js"></script>
  <script src="${ctx.resource}/js/bootstrap.validate.js"></script>
  <script src="${ctx.resource}/js/bootstrap.validate.en.js"></script>
  <script src="${ctx.resource}/js/earth-preupload.js"></script>
  <script src="${ctx.resource}/js/bootstrap-alert-fade-trigger.js"></script>
  <script src="${ctx.resource}/js/bootstrap-datetimepicker.min.js"></script>
  <script src="${ctx.resource}/js/bootstrap-datetimepicker.zh-CN.js"></script>
  
  <script type="text/javascript">
    
    $(".input-group.date").datetimepicker({
        format: "yyyy/mm/dd hh:ii:ss",
        autoclose: true,
        todayBtn: true,
        pickerPosition: "bottom-left",
        language: "zh-CN"
    });
    
    
  
  </script>
  
</body>
</html>
